package org.x.yuenovel.controller;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.x.yuenovel.service.UserInfoService;

import javax.annotation.Resource;

/**
 * @author xuezhendong
 * @date 2022/4/15 9:37 下午
 */
@RestController
@RequestMapping("test")
public class WelcomeController {

    @Resource
    private UserInfoService userInfoService;

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    @GetMapping("hello")
    public String hello() {
        return "hello world";
    }

    @GetMapping("getRedis")
    public String getRedis(@RequestParam String key) {
        return stringRedisTemplate.opsForValue().get(key);
    }
}
